package com.djx.db.controller;

import com.djx.comm.controller.BaseController;
import com.djx.comm.entity.Account;
import com.djx.comm.entity.User;
import com.djx.db.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 用户控制层
 * @author dingjunxiong
 */
@RestController
@RequestMapping("user/")
public class UserController extends BaseController {
    @Autowired
    UserService userService;

    @PostMapping("getById1")
    public Object getById1(String id) throws Exception {
        return successObject(userService.queryById1(id));
    }
    @PostMapping("getPage1")
    public Object getPage1(User user) {
        return successObject(userService.queryPage1(user));
    }


    @PostMapping("getById2")
    public Object getById2(String id) throws Exception {
        return successObject(userService.queryById2(id));
    }
    @PostMapping("getPage2")
    public Object getPage2(Account account) {
        return successObject(userService.queryPage2(account));
    }

}
